home *** CD-ROM | disk | FTP | other *** search
/ Nikkei Mac 20 / NIKKEI-MAC-CD-VOL-20-1998-12.ISO.7z / NIKKEI-MAC-CD-VOL-20-1998-12.ISO / デモソフトライブラリー / 日本テレコムODNスターターキット / Internet Setup / Modem Scripts / 3Com Impact ISDN 64K MLPPP / 3Com Impact ISDN 64K MLPPP next >
Text File  |  1996-11-01  |  5KB  |  288 lines

  1. !  3Com Impact ISDN 64K MLPPP
  2. !    Author:    Kris Kreutzman
  3. !
  4. !    Copyright:    ゥ 1991-1996 Apple Computer, Inc.    All Rights Reserved.
  5. !
  6. !    revision history:
  7. !        v1.1    New template for ISDN modems
  8. !
  9. !  'mlts' resource info for this modem:
  10. !    byte 1 == 01 -> modem HAS built-in error correction protocols
  11. !    byte 2 == 01 -> modem HAS built-in data compression protocols
  12. !    byte 3 == 40 -> max number of chars in varstr 7
  13. !    byte 4 == 40 -> max number of chars in varstr 8
  14. !    byte 5 == 40 -> max number of chars in varstr 9
  15. !    
  16. @ORIGINATE
  17. @ANSWER
  18. !
  19. ! ---- Initial modem setup ----
  20. !
  21. ! Set serial port speed
  22. serreset 115200, 0, 8, 1
  23. !
  24. @LABEL 2
  25. hsreset 0 0 0 0 0 0
  26. settries 0
  27. !
  28. ! Get the modem's attention
  29. !
  30. matchclr
  31. matchstr 1 3 "OK¥13¥10"
  32. write "AT¥13"
  33. matchread 30
  34. !
  35. @LABEL 3
  36. !
  37. ! Setup the modem for the following:
  38. !   Reset to factory settings
  39. !   Standard compression/reliablity
  40. !   Lock serial port speed
  41. !   Serial port hardware handshaking, turn off software handshaking
  42. !   Verbose responces and compression/protocol results
  43. !   CONNECT returns DCE speed
  44. !   Turn off answering
  45. !   Reset or return to command mode on DTR toggle (optional)
  46. !
  47. pause 10
  48. matchclr
  49. matchstr 1 4   "OK¥13¥10"
  50. matchstr 2 101 "ERROR¥13¥10"
  51. write "AT&FE0S0=0S80=1S71=1S60=64¥13"
  52. matchread 30
  53. inctries
  54. iftries 3 101
  55. !
  56. ! Reset the Modem on setup failure
  57. !
  58. DTRClear
  59. pause 5
  60. DTRSet
  61. flush
  62. jump 3
  63. !
  64. !
  65. @LABEL 4
  66. !
  67. ! Modem ready, wait for a call or originate a call
  68. !
  69. @LABEL 13
  70. ifANSWER 32
  71. !
  72. !
  73. ! ---- Originating a call ----
  74. !
  75. @LABEL 19
  76. ! Display the full dialstring contained in Varstring 1
  77. note "Dialing ^1" 3
  78. !
  79. ! Varstrings 7, 8 and 9, contain dialstring fragments
  80. !    Long phone numbers may need to be split into smaller groups
  81. !    for the modem to use
  82. !
  83. ! Varstring 3:  "p" for pulse & "t" for tone dialing
  84. ! Varstring 8 == blank (dialstring in varstring 7)
  85. ! Varstring 9 == blank (dialstring in varstrings 7 & 8)
  86. ! Otherwise (dialstring in varstrings 7, 8 & 9)
  87. ifstr 8 27 " "
  88. ifstr 9 24 " "
  89. !
  90. !  Write dialstring in varstrings 7, 8 & 9
  91. pause 10
  92. matchclr
  93. matchstr 1 21 "OK¥13¥10"
  94. write "ATD^7;¥13"
  95. matchread 400
  96. jump 101
  97.  
  98. @LABEL 21
  99. pause 10
  100. matchclr
  101. matchstr 1 22 "OK¥13¥10"
  102. write "ATD^8;¥13"
  103. matchread 400
  104. jump 101
  105.  
  106. @LABEL 22
  107. pause 10
  108. write "ATD^9¥13"
  109. jump 32
  110. !
  111. !
  112. @LABEL 24
  113. !  Write dialstring in varstrings 7 & 8
  114. pause 10
  115. matchclr
  116. matchstr 1 25 "OK¥13¥10"
  117. write "ATD^7;¥13"
  118. matchread 400
  119. jump 101
  120.  
  121. @LABEL 25
  122. pause 10
  123. write "ATD^8¥13"
  124. jump 32
  125. !
  126. @LABEL 27
  127. !  Write dialstring in varstring 7
  128. pause 10
  129. write "ATD^7¥13"
  130. !
  131. !
  132. !    ---- Connection responce ----
  133. !
  134. ! The following section will parse modem responces:
  135. !
  136. @LABEL 32
  137. matchclr
  138. matchstr  1  81 "RING¥13¥10"
  139. matchstr  2 102 "NO DIALTONE¥13¥10"
  140. matchstr  3 103 "NO CARRIER"
  141. matchstr  4 103 "ERROR¥13¥10"
  142. matchstr  5 104 "BUSY¥13¥10"
  143. matchstr  6 105 "NO ANSWER¥13¥10"
  144. matchstr  7  33 "CARRIER "
  145. matchstr  8  34 "CONNECT "
  146. matchread 700
  147. ifANSWER 32
  148. jump 105
  149. !
  150. @LABEL 33        ! Process CARRIER results
  151. jsr 50
  152. jump 32
  153. !
  154. @LABEL 34        ! Process CONNECT results
  155. jsr 50
  156. jump 60
  157. !
  158. @LABEL 50
  159. matchclr
  160. matchstr  1  56 "56000"
  161. matchstr  2  58 "64000"
  162. matchstr  3  51 "¥10"
  163. matchread 10
  164. @LABEL 51
  165. return
  166. !
  167. ! -- Connection rates --
  168. ! CommunicatingAt informs ARA of the raw modem to modem
  169. ! connection speed.
  170. @LABEL 56
  171. note "Communicating at 56000 bps." 2
  172. CommunicatingAt 56000
  173. return
  174. !
  175. @LABEL 58
  176. note "Communicating at 64000 bps." 2
  177. CommunicatingAt 64000
  178. return
  179. !
  180. !
  181. ! -- Normal exit after "CONNECT" --
  182. !
  183. !  This modem has been setup to do CTS handshaking,
  184. !  and we assume that a CTS handshaking cable is being used.
  185. !
  186. @LABEL 60
  187. ! Turn on CTS handshaking.
  188. HSReset 0 1 0 0 0 0
  189. !
  190. ifANSWER 71
  191. pause 30
  192. @LABEL 71
  193. exit 0
  194. !
  195. !
  196. ! ---- Answer calls ----
  197. !
  198. !    A RING result from the modem and in ANSWERING mode
  199. !    claims the serial port and answering the phone
  200. !
  201. @LABEL 81
  202. ifORIGINATE 32
  203. userhook 1
  204. note "Answering phone..." 2
  205. write "ATA¥13"
  206. jump 32
  207. !
  208. !
  209. ! ---- Hang up and reset modem ----
  210. !
  211. @HANGUP
  212. @LABEL 90
  213. settries 0
  214. HSReset 0 0 0 0 0 0
  215. !
  216. @LABEL 92
  217. !  Escape from data to command mode
  218. matchclr
  219. matchstr 1 96 "OK¥13¥10"
  220. write "+++"
  221. matchread 20
  222. !
  223. @LABEL 94
  224. ! Force a hangup
  225. matchclr
  226. matchstr 1 98 "NO CARRIER¥13¥10"
  227. matchstr 2 98 "OK¥13¥10"
  228. matchstr 3 98 "ERROR¥13¥10"
  229. matchstr 4 98 "0¥13¥10"
  230. write "ATH¥13"
  231. matchread 30
  232. ! Try to get control of the modem by toggling DTR
  233. DTRClear
  234. pause 5
  235. DTRSet
  236. flush
  237. !
  238. ! Try the hangup sequence three times otherwise declare and error
  239. inctries
  240. iftries 3 101
  241. jump 92
  242. !
  243. @LABEL 96
  244. ! Pause between data and command mode
  245. pause 50
  246. jump 94
  247. !
  248. !
  249. @LABEL 98
  250. ! Recall the factory settings
  251. pause 15
  252. matchclr
  253. matchstr 1 99 "OK¥13¥10"
  254. write "AT&F¥13"
  255. matchread 30
  256. jump 101
  257. !
  258. @LABEL 99
  259. exit 0
  260. !
  261. ! ---- Error messages -----
  262. !
  263. ! Modem Not Responding
  264. @LABEL 101
  265. exit -6019
  266. !
  267. ! No Dial Tone
  268. @LABEL 102
  269. exit -6020
  270. !
  271. ! No Carrier or Error
  272. @LABEL 103
  273. exit -6021
  274. !
  275. ! Busy
  276. @LABEL 104
  277. exit -6022
  278. !
  279. ! No Answer
  280. @LABEL 105
  281. exit -6023
  282. !
  283. ! User Cancellation
  284. @LABEL 107
  285. exit -6008
  286.